function navBar(strData){
	var projectPath ="dhjdglxt";
    var data;
    if(typeof(strData) == "string"){
        var data = JSON.parse(strData.data); //部分用户解析出来的是字符串，转换一下
    }else{
        data = strData.data;
    }
    var ulHtml = '<ul class="layui-nav layui-nav-tree">';
    for(var i=0;i<data.length;i++){//一级菜单循环
        if(data[i].spread){
            ulHtml += '<li class="layui-nav-item layui-nav-itemed">';//一级菜单展开
        }else{
            ulHtml += '<li class="layui-nav-item">';//一级菜单关闭
        }
        if(data[i].children != undefined && data[i].children.length > 0){ //判断一级菜单是否有子集菜单
            //有二级菜单
            ulHtml += '<a url="javascript:;" id="'+data[i].id+'">';
            if(data[i].icon != undefined && data[i].icon != ''){   //判断是否有自定义样式
                /*if(data[i].icon.indexOf("icon-") != -1){
                    ulHtml += '<i class="iconfont '+data[i].icon+'" data-icon="'+data[i].icon+'"></i>';
                }else{
                    ulHtml += '<i class="layui-icon" data-icon="'+data[i].icon+'">'+data[i].icon+'</i>';
                }*/
                /*ulHtml += "<span class='iconfont' style='background:url(\""+window.ViewContextPath+'style/images/'+data[i].icon+"\")'>图片</span>";*/
               ulHtml += '<img class="iconfontOpt"  src="'+window.ViewContextPath+"style/images/"+data[i].icon+'"/>&nbsp;&nbsp;';
            }
            ulHtml += '<cite>'+data[i].text+'</cite>';//一级菜单放值
            ulHtml += '<span class="layui-nav-more"></span>';
            ulHtml += '</a>';
            ulHtml += '<dl class="layui-nav-child">'; //二级菜单
            for(var j=0;j<data[i].children.length;j++){   //循还二级菜单
                if(data[i].children[j].spread){
                    ulHtml += '<dd class="layui-nav-item layui-nav-itemed">';//二级菜单展开
                }else{
                    ulHtml += '<dd class="layui-nav-item">';//二级菜单关闭
                }

                if(data[i].children[j].children != undefined && data[i].children[j].children.length > 0){ //判断二级菜单是否有子集
                    //三级菜单有
                    ulHtml += '<a url="javascript:;" id="'+data[i].children[j].id+'">';//二级菜单
                    if(data[i].children[j].icon != undefined && data[i].children[j].icon != ''){
                        /*if(data[i].children[j].icon.indexOf("icon-") != -1){
                            ulHtml += '<i class="iconfont '+data[i].children[j].icon+'" data-icon="'+data[i].children[j].icon+'"></i>';
                        }else{
                            ulHtml += '<i class="layui-icon" data-icon="'+data[i].children[j].icon+'">'+data[i].children[j].icon+'</i>';
                        }*/
                        ulHtml += '<img class="iconfontOpt"  src="'+window.ViewContextPath+"style/images/"+data[i].children[j].icon+'"/>&nbsp;&nbsp;';
                    }
                    ulHtml += '<cite>'+data[i].children[j].text+'</cite>';
                    ulHtml += '<span class="layui-nav-more"></span>';
                    ulHtml += '</a>';
                    ulHtml += '<dl class="layui-nav-child">';
                    for(var z=0;z<data[i].children[j].children.length;z++){
                        if(data[i].children[j].children[z].target == "_blank"){
                        	 if(data[i].children[j].children[z].url.indexOf('apprFlow')>-1){
                             	ulHtml += '<dd><a url="javascript:;" id="'+data[i].children[j].children[z].id+'" data-url="'+window.nginxpath+data[i].children[j].children[z].url+'" target="'+data[i].children[j].children[z].target+'">';
                             }else{
                             	ulHtml += '<dd><a url="javascript:;" id="'+data[i].children[j].children[z].id+'" data-url="'+window.nginxpath+projectPath+data[i].children[j].children[z].url+'" target="'+data[i].children[j].children[z].target+'">';
                             }
                        }else{
                       	 if(data[i].children[j].children[z].url.indexOf('apprFlow')>-1){
                    		 ulHtml += '<dd><a url="javascript:;" id="'+data[i].children[j].children[z].id+'" data-url="'+window.nginxpath+data[i].children[j].children[z].url+'">';
                         }else{
                        	ulHtml += '<dd><a url="javascript:;" id="'+data[i].children[j].children[z].id+'" data-url="'+window.nginxpath+projectPath+data[i].children[j].children[z].url+'">';
                         }
                        }
                        if(data[i].children[j].children[z].icon != undefined && data[i].children[j].children[z].icon != ''){
                            /*if(data[i].children[j].children[z].icon.indexOf("icon-") != -1){
                                ulHtml += '<i class="iconfont '+data[i].children[j].children[z].icon+'" data-icon="'+data[i].children[j].children[z].icon+'"></i>';
                            }else{
                                ulHtml += '<i class="layui-icon" data-icon="'+data[i].children[j].children[z].icon+'">'+data[i].children[j].children[z].icon+'</i>';
                            }*/
                            ulHtml += '<img class="iconfontOpt"  src="'+window.ViewContextPath+"style/images/"+data[i].children[j].children[z].icon+'"/>&nbsp;&nbsp;';
                        }
                        ulHtml += '<cite class="thirdMenu">'+data[i].children[j].children[z].text+'</cite></a></dd>';
                    }
                    ulHtml += "</dl>";
                }else{
                    //没有三级菜单
                    if(data[i].children[j].target == "_blank"){
                    	 if(data[i].children[j].children[z].url.indexOf('apprFlow')>-1){
                    		 ulHtml += '<a url="javascript:;" id="'+data[i].children[j].id+'" data-url="'+window.nginxpath+data[i].children[j].url+'" target="'+data[i].children[j].target+'">';
                         }else{
                        	 ulHtml += '<a url="javascript:;" id="'+data[i].children[j].id+'" data-url="'+window.nginxpath+projectPath+data[i].children[j].url+'" target="'+data[i].children[j].target+'">';
                         }
                    }else{
                    	if(data[i].children[j].url.indexOf('apprFlow')>-1){
                   		 ulHtml += '<a url="javascript:;" id="'+data[i].children[j].id+'" data-url="'+window.nginxpath+data[i].children[j].url+'">';
                        }else{
                       	 ulHtml += '<a url="javascript:;" id="'+data[i].children[j].id+'" data-url="'+window.nginxpath+projectPath+data[i].children[j].url+'">';
                        }
                    }
                    if(data[i].children[j].icon != undefined && data[i].children[j].icon != ''){
                        /*if(data[i].children[j].icon.indexOf("icon-") != -1){
                            ulHtml += '<i class="iconfont '+data[i].children[j].icon+'" data-icon="'+data[i].children[j].icon+'"></i>';
                        }else{
                            ulHtml += '<i class="layui-icon" data-icon="'+data[i].children[j].icon+'">'+data[i].children[j].icon+'</i>';
                        }*/
                        ulHtml += '<img class="iconfontOpt"  src="'+window.ViewContextPath+"style/images/"+data[i].children[j].icon+'"/>';
                    }
                    ulHtml += '<cite>'+data[i].children[j].text+'</cite></a>';
                }

                //三级菜单结束
                /*if(data[i].children[j].target == "_blank"){
                    ulHtml += '<dd><a url="javascript:;" data-url="'+data[i].children[j].url+'" target="'+data[i].children[j].target+'">';
                }else{
                    ulHtml += '<dd><a url="javascript:;" data-url="'+data[i].children[j].url+'">';
                }
                if(data[i].children[j].icon != undefined && data[i].children[j].icon != ''){
                    if(data[i].children[j].icon.indexOf("icon-") != -1){
                        ulHtml += '<i class="iconfont '+data[i].children[j].icon+'" data-icon="'+data[i].children[j].icon+'"></i>';
                    }else{
                        ulHtml += '<i class="layui-icon" data-icon="'+data[i].children[j].icon+'">'+data[i].children[j].icon+'</i>';
                    }
                }
                ulHtml += '<cite>'+data[i].children[j].text+'</cite></a></dd>';*/
            }
            ulHtml += "</dl>";
        }else{
            //没有二级菜单
            if(data[i].target == "_blank"){
            	if(data[i].url.indexOf('apprFlow')>-1){
            		ulHtml += '<a url="javascript:;" id="'+data[i].id+'" data-url="'+window.nginxpath+data[i].url+'" target="'+data[i].target+'">';target+'">';
                }else{
                 ulHtml += '<a url="javascript:;" id="'+data[i].id+'" data-url="'+window.nginxpath+projectPath+data[i].url+'" target="'+data[i].target+'">';
                }
            }else{
            	if(data[i].url.indexOf('apprFlow')>-1){
            		ulHtml += '<a url="javascript:;" id="'+data[i].id+'" data-url="'+window.nginxpath+data[i].url+'">';
                }else{
                	ulHtml += '<a url="javascript:;" id="'+data[i].id+'" data-url="'+window.nginxpath+projectPath+data[i].url+'">';
                }
            }
            if(data[i].icon != undefined && data[i].icon != ''){
               /* if(data[i].icon.indexOf("icon-") != -1){
                    ulHtml += '<i class="iconfont '+data[i].icon+'" data-icon="'+data[i].icon+'"></i>';
                }else{
                    ulHtml += '<i class="layui-icon" data-icon="'+data[i].icon+'">'+data[i].icon+'</i>';
                }*/
                ulHtml += '<img class="iconfontOpt"  src="'+window.ViewContextPath+"style/images/"+data[i].icon+'"/>';
            }
            ulHtml += '<cite>'+data[i].text+'</cite></a>';
        }
        ulHtml += '</dd>';
    }
    ulHtml += '</ul>';
    return ulHtml;
}
